<template>
  <div id="app">
    <Index />
    <router-view :order="order" @input="updateOrder"></router-view>
  </div>
  
</template>
<script>
  import Index from './components/Header.vue'
  import Home from './pages/Home.vue'
  export default {
    components: {
      Home, 
      Index
    },
    name: 'HelloWorld',
    props: {
      msg: String
    },
    data(){
      return{
        order:{
          name:""
        }
      }
    },
    methods:{
      updateOrder(data){
        this.order = data;
        this.order.name = this.order.list[0].name+"..."
        this.order.date= new Date();
        console.log("app update");
        
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>

</style>